package com.thinkgsp.jxc.service;

import java.sql.Date;
import java.util.List;

import com.thinkgsp.jxc.model.RpArpBill;
import com.thinkgsp.jxc.model.RpPayBill;
import com.thinkgsp.jxc.model.RpRecBill;
import com.thinkgsp.jxc.persistence.ContactBalanceMapper;
import com.thinkgsp.jxc.persistence.RpArpBillMapper;
import com.thinkgsp.jxc.persistence.RpBillMapper;
import com.thinkgsp.jxc.persistence.RpContactMapper;
import com.thinkgsp.jxc.persistence.mybatis.PagingResult;

/**
 * 收款付款单据业务类
 * @author evan
 *
 */
public interface RpBillService extends RpService {

	/**
	 * 本方法用于测试目的
	 * @param arpBillMapper
	 */
	public void setRpArpBillMapper(RpArpBillMapper arpBillMapper);
	
	/**
	 * 本方法用于测试目的
	 * @param rpBillMapper
	 */
	public void setRpBillMapper(RpBillMapper rpBillMapper);
	
	/**
	 * 本方法用于测试目的
	 * @param contactMapper
	 */
	public void setRpContactMapper(RpContactMapper contactMapper);
	
	/**
	 * 本方法用于测试目的
	 * @param cbMapper
	 */
	public void setContactBalanceMapper(ContactBalanceMapper cbMapper);	
	/**
	 * 根据Id读取收款单据
	 * @param billId
	 * @return
	 */
	public RpRecBill getRecBill(Long billId);
	
	/**
	 * 根据Id读取付款单据
	 * @param billId
	 * @return
	 */
	public RpPayBill getPayBill(Long billId);
	
	/**
	 * 读取收款单据列表
	 * @param begDate
	 * @param endDate
	 * @return
	 */
	public List<RpRecBill> getRecBillList(Date begDate,Date endDate);
	
	/**
	 * 读取收款单据列表(分页)
	 * @param begDate
	 * @param endDate
	 * @param start
	 * @param size
	 * @return
	 */
	public PagingResult<RpRecBill> getRecBillList(Date begDate,Date endDate,int start,int size);
	
	/**
	 * 读取收款单据列表
	 * @param begDate
	 * @param endDate
	 * @param custId
	 * @return
	 */
	public List<RpRecBill> getRecBillList(Date begDate,Date endDate,Integer custId);
	
	/**
	 * 读取收款单据列表(分页)
	 * @param begDate
	 * @param endDate
	 * @param start
	 * @param size
	 * @return
	 */
	public PagingResult<RpRecBill> getRecBillList(Date begDate,Date endDate,Integer custId,int start,int size);	
	
	/**
	 * 读取付款单据列表
	 * @param begDate
	 * @param endDate
	 * @return
	 */
	public List<RpPayBill> getPayBillList(Date begDate,Date endDate);
	
	/**
	 * 读取付款单据列表(分页)
	 * @param begDate
	 * @param endDate
	 * @param start
	 * @param size
	 * @return
	 */
	public PagingResult<RpPayBill> getPayBillList(Date begDate,Date endDate,int start,int size);
	
	/**
	 * 读取付款单据列表
	 * @param begDate
	 * @param endDate
	 * @param custId
	 * @return
	 */
	public List<RpPayBill> getPayBillList(Date begDate,Date endDate,Integer custId);
	
	/**
	 * 读取付款单据列表(分页)
	 * @param begDate
	 * @param endDate
	 * @param start
	 * @param size
	 * @return
	 */
	public PagingResult<RpPayBill> getPayBillList(Date begDate,Date endDate,Integer custId,int start,int size);	
	/**
	 * 根据应收单创建收款单据
	 * @param arecBillId 应收单据Id
	 * @return
	 * @throws ServiceException
	 */
	public RpRecBill createRecBillByArecBill(Long arecBillId) throws ServiceException;
	
	/**
	 * 根据应付单创建付款单据
	 * @param apayBillId 应付单据Id
	 * @return 
	 * @throws ServiceException
	 */
	public RpPayBill createPayBillByApayBill(Long apayBillId) throws ServiceException;
	
	/**
	 * 获取未结算的应收单
	 * @param custId
	 * @return
	 */
	public List<RpArpBill> getUnSettleARecBill(Integer custId);
	
	/**
	 * 获取未结算的应付单
	 * @param custId
	 * @return
	 */
	public List<RpArpBill> getUnSettleAPayBill(Integer custId);
	
	/**
	 * 获取未结算的收款单
	 * @param custId
	 * @return
	 */
	public List<RpRecBill> getUnSettleRecBill(Integer custId);
	
	/**
	 * 获取未结算的付款单
	 * @param custId
	 * @return
	 */
	public List<RpPayBill> getUnSettlePayBill(Integer custId);
	
	/**
	 * 获取未结算的退款单(收款)
	 * @param custId
	 * @return
	 */
	public List<RpRecBill> getUnSettleRefundRecBill(Integer custId);
	
	/**
	 * 获取未结算的退款单(付款)
	 * @param custId
	 * @return
	 */
	public List<RpPayBill> getUnSettleRefundPayBill(Integer custId);
}
